class CreateIntervals < ActiveRecord::Migration
  def self.up
    create_table :intervals do |t|
      t.integer :day
      t.time :starts
      t.time :ends

      t.timestamps
    end
    add_index(:intervals, [:day, :starts, :ends], :unique => true)
  end

  def self.down
    remove_index(:intervals, :column => [:day, :starts, :ends])
    drop_table :intervals
  end
end
